const mongoose = require('mongoose')
const moment = require('moment')
const Schema = mongoose.Schema
const adminsSchema = new Schema({
  username: {
    type: String,
    required: true,
    unique: true,
  },
  password: {
    type: String,
    required: true,
  },
  last_login: {
    type: String,
    default: moment(Date.now()).format('YYYY-MM-DD HH:mm:ss'),
  },
  registe_date: {
    type: String,
    default: moment(Date.now()).format('YYYY-MM-DD HH:mm:ss'),
  },
  token: {
    type: String,
    default: '',
  },
})

module.exports = mongoose.model('admins', adminsSchema)
